package arch.chameleon.module.security.provider;

import java.security.Security;

import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;

/**
 * 为JDK提供第三方的Security Provider以丰富其安全特性
 * @author George
 *
 */
public class CustomBouncyCastleProvider implements InitializingBean {

	@Override
	public void afterPropertiesSet() throws Exception {
		Security.addProvider(new BouncyCastleProvider());
		log.info("added BouncyCastleProvider to JDK security configuration.");
	}
	
	private transient Logger log = LoggerFactory.getLogger(this.getClass());

}
